// 处理进度加载
import { useEffect, useState } from "react";
import nProgress from "nprogress";

export function usePageLoadingGuard() {
  useState(nProgress.start()); //每次刷新的时候都启用进度条
  useEffect(() => {
    //每次路由切换的时候启用进度条
    nProgress.done();
    return () => nProgress.start();
  });
}
